package com.zzyl.nursing.controller.member;

import com.baidubce.qianfan.model.console.ServiceItem;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.dto.ServiceItemDto;
import com.zzyl.nursing.service.INursingProjectService;
import com.zzyl.nursing.service.ServiceItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/member/orders/project")
@Slf4j
@Api(tags = "服务项目")
public class ServiceItemController {


    @Autowired
    private ServiceItemService serviceItemService;




    @GetMapping("/page")
    @ApiOperation("分页查询护理项目列表")
    public TableDataInfo page(@RequestParam Integer pageNum, @RequestParam Integer pageSize){
        log.info("分页查询护理项目列表,分页参数{},{}",pageNum,pageSize);
        TableDataInfo<NursingProject> list = serviceItemService.listPageAll(pageNum, pageSize);
        return list;
    }

    @GetMapping("/{id}")
    @ApiOperation("查询护理项目详情")
    public AjaxResult getById(@PathVariable Long id){
        log.info("查询护理项目详情,id:{}",id);
        NursingProject nursingProject = serviceItemService.getById(id);
        return AjaxResult.success(nursingProject);
    }

}
